<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:composite="http://java.sun.com/jsf/composite"
 xmlns:c="http://java.sun.com/jsp/jstl/core"
 xmlns:t="http://myfaces.apache.org/tomahawk"
 >
<ui:composition template="../templates/template.xhtml">
<f:loadBundle basename="us.gaaoc.framework.webapp.util.userMessage" var="bundle" />
	<ui:define name="title">
	 	User Profile :: Change Password
	</ui:define>

	<ui:param name="page" value="changePassword" /> 
	<ui:param name="profile" value="changePassword" /> 
	
	<ui:define name="header">
		<ui:include src="/secure/header.xhtml" /> 
	</ui:define>

	<ui:define name="pageTitle">
	<script>
		currentmenu="viewProfile";
	</script>
		<h:outputText style="font-weight:normal;"
						value="#{bundle.changepassword}" />		
	</ui:define>

	<ui:define name="body">
		<h:form>
			<br /> 
		
			<ul id="tabmenu"  class="nav">				
				<c:forEach var="link" items="#{userProfile.menu}">
					 <c:choose>
						<c:when test="#{link.navigationRule == profile}">
							<li><h:commandLink styleClass="active" value="#{link.text}" action="#{link.doNavigation}" immediate="true" /></li>
						</c:when>
						<c:otherwise>
							<li><h:commandLink value="#{link.text}" action="#{link.doNavigation}" immediate="true" /></li>
						</c:otherwise> 
					</c:choose> 
				</c:forEach>
				
				
			</ul>
			
			<h:outputText value="#{changePassword.messageString}" />
			
			
			<div id="content">
				<h:panelGrid columns="3" > 
			
				<f:facet name="header">
					Change password for user: #{person.firstName} #{person.lastName} 
				</f:facet>	
				</h:panelGrid>
				<h:panelGrid columns="3">
				<h:column> 
					Enter new password: 
				</h:column>
				<h:column> 
					<h:inputSecret id="newPassword" value="#{changePassword.newPassword}" required="true" >
					  <f:validateLength minimum = "6" maximum = "10"/>
					  <f:validator validatorId = "ConfirmPasswordValidator"/>
					</h:inputSecret>
				</h:column>
			<h:column> 
			<h:message for="newPassword" styleClass="error" /> 
				</h:column>	
				<h:column> 
					Confirm new password:
				</h:column>
				<h:column> 
					<h:inputSecret id="confirmPassword" value="#{changePassword.confirmPassword}" required="true">
					<f:validateLength minimum = "6" maximum = "10"/>
					<f:validator validatorId = "ConfirmPasswordValidator"/>
					</h:inputSecret> 
				</h:column>
				
				<h:column> 
				<h:message for="confirmPassword" styleClass="error" /> 
				</h:column>	
				<h:column> 
					<h:commandButton value="Change Password" action="#{changePassword.changePassword}" styleClass="buttonClass"/> 
				</h:column>				
			</h:panelGrid>
			</div>						 
		</h:form>
	</ui:define>

</ui:composition>

</html>
